<template>
  <div class="screen-full">
    <svg-icon icon-class="eye" @click="toggleFullScreen" />
  </div>
</template>

<script>
import screenfull from 'screenfull'

export default {
  name: '',
  data() {
    return {
      isFull: false
    }
  },
  created() {
    // 全屏切换的监听回调
    screenfull.on('change', () => {
      console.log(screenfull.isFullscreen)
      this.isFull = screenfull.isFullscreen
    })
  },
  methods: {
    toggleFullScreen() {
      screenfull.toggle()
    }

  }
}
</script>

  <style lang="scss" scoped>
  .screen-full {
    display: inline-block;
    color: #ed6e6e;
    margin-right: 15px;
  }
  </style>
